package com.heima.article.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

/**
 * 目的加载es，并把RestHighLevelClient类注入到IOC容器中
 */
@Configuration
@ConfigurationProperties(prefix = "elasticsearch")
@Data
public class ESConfig {
    private String host;
    private int port;
    //把RestHighLevelClient类注入到spring IOC容器中，表示连接上es
   /* @Bean
    public RestHighLevelClient client(){
        return new RestHighLevelClient(RestClient.builder(
                new HttpHost(host,port,"http")
        ));
    }*/
}